<script type="text/javascript" charset="utf-8" src="/uedit/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="https://cdn.staticfile.org/ueditor/1.4.3/ueditor.all.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="/uedit/lang/zh-cn/zh-cn.js"></script>
<style>
.edui-popup-content.edui-default{ height: auto !important; }
</style>
<div class="row">
	<div class="col-lg-12">
		<h1 class="site-h1" style="background-color:#FFFFFF;">
			注册协议<#if registryList??>（${registryList.totalElements!''}）</#if>
		</h1>
		<div class="row" style="padding:5px;">
			<div class="col-lg-12">
				<form class="layui-form uk-form" action="/admin/registry/save.html"  method="post">
					<div class="layui-block" style="margin-bottom: 20px;">
		            	
		            	<#if registryList??>
						<#list registryList.content as content>
							<#if content_index == 0>
						      	<textarea id="registrycontent" name="registrycontent" placeholder="请输入正文" >
									
		            			</textarea>
		            			<input type="hidden" id="content" value="${content.registrycontent!''}">
			            		<input type="hidden" name="id" value="${content.id!''}">
					    	</#if>
						</#list>
						</#if>
						<#if countrow == '0'>
							<textarea id="registrycontent" name="registrycontent" placeholder="请输入正文" >

		            		</textarea>
						</#if>
		            </div>
			       <div class="layui-button-block">
		                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
		            </div>
			    </form>
			</div> 	   
		</div>
	</div>	
</div>
<script>

layui.use(['layer','layedit'], function(){
  var form = layui.form(),layer = layui.layer;
  form.render(); //更新全部
});

var ue = UE.getEditor('registrycontent', {
	//这里可以选择自己需要的工具按钮名称
	toolbars: [
		['Source','|', 'undo', 'redo', 'removeformat', 'backcolor', 'formatmatch','|', 'italic', 'underline', 'Bold', 'test',
			'forecolor','|', 'justifyleft', 'justifycenter', 'justifyright','|','insertorderedlist' ,'|',
			'fontfamily', 'fontsize','|',
			 'simpleupload','emotion'
		]
	],
	wordCount: false,					//开启字数统计
	elementPathEnabled : false,
	zIndex : 1800
});

//编辑器加载完成后赋值
ue.addListener("ready", function () {
	ue.setHeight(500);
	ue.setContent($("#content").val());
});
</script>